import React from 'react';

import BoxItem from '../../../components/BoxItem';
import BorderTable from '../components/BorderTable';

import { Button, DatePicker, Form, Input, Select } from 'antd';

const { RangePicker } = DatePicker;

export default function LocationInventoryCount() {
	const columns = [
		{ title: '单据编码', dataIndex: 'documentCode', key: 'documentCode' },
		{ title: '盘点标题', dataIndex: 'inventoryTitle', key: 'inventoryTitle' },
		{ title: '仓库', dataIndex: 'warehouse', key: 'warehouse' },
		{ title: '盈亏数量', dataIndex: 'profitLossQuantity', key: 'profitLossQuantity' },
		{ title: '盈亏金额', dataIndex: 'profitLossAmount', key: 'profitLossAmount' },
		{ title: '盘点状态', dataIndex: 'inventoryStatus', key: 'inventoryStatus' },
		{ title: '创建时间', dataIndex: 'creationTime', key: 'creationTime' },
		{ title: '备注', dataIndex: 'remarks', key: 'remarks' },
		{ title: '操作', dataIndex: 'operation', key: 'operation' }
	];

	const dataSource = [
		{
			key: '1',
			documentCode: 'DOC001',
			inventoryTitle: '产品A',
			warehouse: '仓库1',
			profitLossQuantity: 50,
			profitLossAmount: 1000,
			inventoryStatus: '未盘点', // 修改为未盘点
			creationTime: '2024-11-01 08:30:00',
			remarks: '无',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '2',
			documentCode: 'DOC002',
			inventoryTitle: '产品B',
			warehouse: '仓库2',
			profitLossQuantity: -20,
			profitLossAmount: -500,
			inventoryStatus: '盘点中', // 修改为盘点中
			creationTime: '2024-11-02 09:00:00',
			remarks: '待补货',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '3',
			documentCode: 'DOC003',
			inventoryTitle: '产品C',
			warehouse: '仓库1',
			profitLossQuantity: 10,
			profitLossAmount: 200,
			inventoryStatus: '盘点完成', // 修改为盘点完成
			creationTime: '2024-11-03 10:15:00',
			remarks: '库存充足',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '4',
			documentCode: 'DOC004',
			inventoryTitle: '产品D',
			warehouse: '仓库3',
			profitLossQuantity: -5,
			profitLossAmount: -100,
			inventoryStatus: '已调账', // 修改为已调账
			creationTime: '2024-11-04 11:00:00',
			remarks: '待采购',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '5',
			documentCode: 'DOC005',
			inventoryTitle: '产品E',
			warehouse: '仓库2',
			profitLossQuantity: 30,
			profitLossAmount: 600,
			inventoryStatus: '未盘点', // 修改为未盘点
			creationTime: '2024-11-05 12:30:00',
			remarks: '热销',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '6',
			documentCode: 'DOC006',
			inventoryTitle: '产品F',
			warehouse: '仓库1',
			profitLossQuantity: 15,
			profitLossAmount: 300,
			inventoryStatus: '盘点中', // 修改为盘点中
			creationTime: '2024-11-06 13:45:00',
			remarks: '新到货',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '7',
			documentCode: 'DOC007',
			inventoryTitle: '产品G',
			warehouse: '仓库3',
			profitLossQuantity: -10,
			profitLossAmount: -200,
			inventoryStatus: '盘点完成', // 修改为盘点完成
			creationTime: '2024-11-07 14:00:00',
			remarks: '即将到货',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '8',
			documentCode: 'DOC008',
			inventoryTitle: '产品H',
			warehouse: '仓库2',
			profitLossQuantity: 40,
			profitLossAmount: 800,
			inventoryStatus: '已调账', // 修改为已调账
			creationTime: '2024-11-08 15:10:00',
			remarks: '畅销',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '9',
			documentCode: 'DOC009',
			inventoryTitle: '产品I',
			warehouse: '仓库1',
			profitLossQuantity: -30,
			profitLossAmount: -600,
			inventoryStatus: '未盘点', // 修改为未盘点
			creationTime: '2024-11-09 16:00:00',
			remarks: '低库存',
			operation: ['复制', '详情', '关闭']
		},
		{
			key: '10',
			documentCode: 'DOC010',
			inventoryTitle: '产品J',
			warehouse: '仓库3',
			profitLossQuantity: 20,
			profitLossAmount: 400,
			inventoryStatus: '盘点中', // 修改为盘点中
			creationTime: '2024-11-10 17:30:00',
			remarks: '库存充足',
			operation: ['复制', '详情', '关闭']
		}
	];

	return (
		<div>
			<BoxItem>
				<Button style={{ marginRight: '20px' }} size="large" type="primary">
					新建
				</Button>
				<Button style={{ marginRight: '20px' }} size="large">
					导入
				</Button>
				<Button size="large">导出</Button>
			</BoxItem>
			<BoxItem>
				<Form
					layout="inline" // 使用 inline 布局使所有字段并排显示
					style={{ maxWidth: '100%' }}
				>
					<Form.Item
						label="商品"
						style={{ width: '300px', marginBottom: '20px' }}
						wrapperCol={{ span: 20 }}
					>
						<Input placeholder="请输入关键词搜索" />
					</Form.Item>
					<Form.Item label="状态" style={{ width: '170px' }} wrapperCol={{ span: 15 }}>
						<Select defaultValue="请选择">
							<Select.Option value="未盘点">未盘点</Select.Option>
							<Select.Option value="盘点中">盘点中</Select.Option>
							<Select.Option value="已完成">已完成</Select.Option>
							<Select.Option value="已调帐">已调帐</Select.Option>
						</Select>
					</Form.Item>
					<Form.Item label="仓库盘点" style={{ width: '250px' }} wrapperCol={{ span: 15 }}>
						<Select defaultValue="请选择">
							<Select.Option value="仓库A">仓库A</Select.Option>
							<Select.Option value="仓库B">仓库B</Select.Option>
							<Select.Option value="仓库C">仓库C</Select.Option>
						</Select>
					</Form.Item>
					<Form.Item label="创建时间" style={{ width: '400px' }} wrapperCol={{ span: 20 }}>
						<RangePicker />
					</Form.Item>
					<Form.Item style={{ width: '400px' }} wrapperCol={{ span: 20 }}>
						<Button style={{ marginRight: '20px' }}>今</Button>
						<Button style={{ marginRight: '20px' }}>昨</Button>
						<Button style={{ marginRight: '20px' }}>近7天</Button>
						<Button>近30天</Button>
					</Form.Item>
					<Form.Item>
						<Button type="primary" style={{ marginRight: '20px' }}>
							搜索
						</Button>
						<Button>重置</Button>
					</Form.Item>
				</Form>
			</BoxItem>
			<BoxItem>
				<BorderTable columns={columns} dataSource={dataSource} />
			</BoxItem>
		</div>
	);
}
